{% extends 'layout.html' %}
{% load static %}
{% block css %}
    <link rel="stylesheet" href="{% static '/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css' %}">
{% endblock %}
{% block content %}
    <form method="post" novalidate>
        {% csrf_token %}
        <div class="container">
            {% for field in form %}
                <label for="inputEmail3" class="col-sm control-label"><span class="glyphicon glyphicon-ok"
                     aria-hidden="true"></span> {{ field.label }}:</label>
                {{ field }}
                <p style="color: red"> {{ field.errors.0 }}</p>
            {% endfor %}
            {#                        {% for field in form %}#}
            {#                            {{ field.label }}:{{ field }}#}
            {#                        {% endfor %}#}
            {#    {{ form.name.label }} : {{ form.name }}#}
            {#   {{ form.age.label }} : {{ form.age }}#}
            {#   {{ form.password .label }} : {{ form.password }} #}
            <input type="submit" style="margin-top: 20px" class="btn btn-success">
        </div>
    </form>
{% endblock %}

{% block js %}
    <script src="{% static 'plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js' %}"></script>
    <script src="{% static 'plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js' %}"></script>
    <script>
        $(function () {
            $('#id_create_time').datetimepicker({
                format: 'yyyy-mm-dd',
                weekStart: 1,
                startView: 2,
                minView: 2,
                forceParse: false,
                language: 'zh-CN',
                autoclose: true
            });
        })
    </script>
{% endblock %}